import Vue from 'vue'
import Vuex from 'vuex'
import { getItem, setItem } from '../utils/storage'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    user: getItem('heima_token')
  },
  mutations: {
    initUser (state, data) {
      state.user = data
      setItem('heima_token', data)// 存在本地存储
    }

  },
  actions: {
  },
  modules: {
  }
})
